
<%-------------------------------------------------------------------
 * 页面名称：ivr_password.jsp
 * 功能描述：设置您的电话帐户
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.Constant"%>
<%@ page import="cn.agiledata.bank.account.service.AccountSummary"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
	String path = request.getContextPath();
	AccountSummary user = (AccountSummary) session
			.getAttribute(Constant.SESSION_ACCOUNT_SUMMARY);
%>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<SCRIPT LANGUAGE="JavaScript">
	function submitProcess() {
		var formName = document.forms["0"];
		if (formName.isOpen.value=='N') {
			if (confirm('您确定要关闭电话账户吗？')) {
				formName.submit();
			}
		}else if (checkNecessaryInput(formName)) {
			var logNewPass = formName.logNewPass;
			if(logNewPass.value.length<6||logNewPass.value.length>15){
				alert("登录密码长度必须为6-15位");
				return;
			}
			if(isNaN(logNewPass.value)){
				alert("请使用数字作为您的电话账户的密码");
				return;
			}
			
			var modNewPass = formName.modNewPass;
			if(modNewPass.value.length<6||modNewPass.value.length>15){
				alert("支付密码长度必须为6-15位");
				return;
			}
			if(isNaN(modNewPass.value)){
				alert("请使用数字作为您的电话账户的密码");
				return;
			}
			
			var logReNewPass = formName.logReNewPass;
			if(logNewPass.value != logReNewPass.value){
				alert("您两次输入的电话账号登录密码不一致");
				return;
			}
			
			var modReNewPass = formName.modReNewPass;
			if(modNewPass.value != modReNewPass.value){
				alert("您两次输入的电话账号支付验证密码不一致");
				return;
			}
			
			formName.submit();
		}
	}
</SCRIPT>
<div id="mainFrame">
	<div class="rightSider">
		<div class="sub_title">
			<span class="bluefont18bdrop">设置电话账户</span>
		</div>
		<div class="edit_pass">
			<table width="100%" border="0" align="center" cellpadding="5"
				cellspacing="1">
				<html:form action="newIVRSubmit" method="post">
					<!--电话账号-->
					<tr>
						<td height="30" align="right">
							电话账号：
						</td>
						<td bgcolor="#FFFFFF">
							<bean:write name="account" property="accountId" />
						</td>
					</tr>
					<!--关闭电话账户/开通电话账户-->
					<logic:equal name="account" property="ivrStatus" value="Y">
						<tr>
							<td width="27%" height="30" align="right">
								关闭电话账户：
							</td>
							<td width="73%" bgcolor="#FFFFFF">
								<div class="select">
									<div>
										<select name="isOpen">
											<option value="N" selected>
												关闭电话账户
											</option>
										</select>
									</div>
								</div>
							</td>
						</tr>
					</logic:equal>
					<logic:equal name="account" property="ivrStatus" value="N">
						<tr>
							<td width="27%" height="30" align="right">
								开通电话账户：
							</td>
							<td width="73%" bgcolor="#FFFFFF">
								<div class="select">
									<div>
										<select name="isOpen">
											<option value="Y" selected>
												开通电话账户
											</option>
										</select>
									</div>
								</div>
							</td>
						</tr>
						<!--选择付费子账户-->
						<tr>
							<td height="30" align="right">
								选择付费子账户：
							</td>
							<td bgcolor="#FFFFFF">
								<div class="select">
									<div>
										<html:select property="subId">
											<html:options collection="subList" property="id"
												labelProperty="accountName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<!--请输入账户支付密码-->
						<tr>
							<td height="30" align="right" valign="top">
								<span class="orang12b">*</span> 请输入账户支付密码：
							</td>
							<td bgcolor="#FFFFFF">
								<html:password property="pass" alt="支付密码" value=""
									styleClass="inputStyle" />
								<br />
								<span class="font_gray">(6-15位数字) </span>
							</td>
						</tr>
						<!--电话账号登录密码-->
						<tr>
							<td height="30" align="right" valign="top">
								<span class="orang12b">* </span>电话账号登录密码：
							</td>
							<td bgcolor="#FFFFFF">
								<html:password property="logNewPass" alt="电话账号登录密码" value=""
									styleClass="inputStyle" />
								<br />
								<span class="font_gray">(6-15位数字) </span>
							</td>
						</tr>
						<!-- 重复电话账号登录密码-->
						<tr>
							<td height="30" align="right" valign="top">
								<span class="orang12b">*</span> 重复电话账号登录密码：
							</td>
							<td bgcolor="#FFFFFF">
								<html:password property="logReNewPass" alt="重复电话账号登录密码" value=""
									styleClass="inputStyle" />
								<br />
								<span class="font_gray">(6-15位数字) </span>
							</td>
						</tr>
						<!--电话账号支付密码-->
						<tr>
							<td height="30" align="right" valign="top">
								<span class="orang12b">* </span>电话账号支付密码：
							</td>
							<td bgcolor="#FFFFFF">
								<html:password property="modNewPass" alt="电话账号支付密码" value=""
									styleClass="inputStyle" />
								<span class="font_gray"><br /> (6-15位数字) </span>
							</td>
						</tr>
						<!--重复电话账号支付密码-->
						<tr>
							<td height="30" align="right" valign="top">
								<span class="orang12b">* </span>重复电话账号支付密码：
							</td>
							<td bgcolor="#FFFFFF">
								<html:password property="modReNewPass" alt="重复电话账号支付密码" value=""
									styleClass="inputStyle" />
								<span class="font_gray"><br /> (6-15位数字) </span>
							</td>
						</tr>
					</logic:equal>
					<logic:notEqual name="IVRForm" property="errorMsg" value="">
						<tr>
							<td height="25" align="center" class="twoSiderLine">
								&nbsp;
								<font color="#FF0000"><bean:write name="IVRForm"
										property="errorMsg" />！</font>
							</td>
						</tr>
					</logic:notEqual>
					<logic:notEqual name="delError" value="">
						<tr>
							<td height="25" align="center" class="twoSiderLine">
								&nbsp;
								<font color="#FF0000"><%=request.getSession().getAttribute("delError")%>！</font>
							</td>
						</tr>
						<%
						request.getSession().removeAttribute("delError");
						%>
					</logic:notEqual>
					<tr>
						<td height="55" align="right">
							&nbsp;
						</td>
						<td height="50" bgcolor="#FFFFFF">
							<input type="button" name="sure" value="确 定" class="button_style"
								onclick="submitProcess();" />
							<input type="button" name="return" value="返 回"
								class="button_style"
								onclick="loading('<%=path%>/route.do?modual=space$account&showTab=3');" />
						</td>
					</tr>

				</html:form>
			</table>
		</div>
	</div>
</div>
<div align="center">
	<!-- include 我的账户左侧账户管理菜单 -->
	<jsp:include page="left.jsp?current=telacct" />
</div>
